package stocc.converter;

import java.util.ArrayList;
import java.util.List;

import stocc.ParserOutputHandler;
import stocc.logger.Logger;
import stocc.subject.Member;
import stocc.subject.Method;
import stocc.subject.Subject;
import stocc.subject.View;
import stocc.subject.Visibility;

public class ConverterTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Logger.getLogger().setLevel("DEBUG");
		
		Subject s = new Subject("test");
		View v = new View();
		v.setName("Car");
		
		v.setVisibility(Visibility.PUBLIC);
		
		v.addMember(new Member("weight", Visibility.PROTECTED, "int"));
		v.addMember(new Member("owner", Visibility.PRIVATE, "String"));
		
		List<String> params2 = new ArrayList<String>();
		params2.add("int weight");
		v.addMethod(new Method(
					Visibility.PUBLIC,
					"",
					"Car",
					params2,
					"this.weight = weight;"));

		List<String> params = new ArrayList<String>();
		params.add("String owner");
		v.addMethod(new Method(
					Visibility.PUBLIC,
					"void",
					"setOwner",
					params,
					"this.owner = owner;"));

		
		List<String> params3 = new ArrayList<String>();
		v.addMethod(new Method(
					Visibility.PUBLIC,
					"String",
					"getOwner",
					params3,
					"return this.owner;"));
		
		s.addView(v);
		
		System.out.println("Blah");
		
		try{
		ParserOutputHandler out = new Converter();
		out.addSubject(s);
		out.done();
		}catch (Exception e){
			System.out.println("Error: " + e.toString());
			e.printStackTrace();
		}
	}

}
